package sbpme.designer.policy;

import org.eclipse.gef.commands.Command;
import org.eclipse.gef.editpolicies.ComponentEditPolicy;
import org.eclipse.gef.requests.GroupRequest;

import sbpme.designer.command.ActivityDeleteCommand;
import sbpme.designer.model.Activity;
import sbpme.designer.model.ProcessDiagram;

public class ActivityComponentEditPolicy extends ComponentEditPolicy {

	@Override
	protected Command createDeleteCommand(GroupRequest deleteRequest) {
		ProcessDiagram parent = (ProcessDiagram) (getHost().getParent().getModel());
		ActivityDeleteCommand deleteCmd = new ActivityDeleteCommand();
		deleteCmd.setParent(parent);
		deleteCmd.setChild((Activity) (getHost().getModel()));
		return deleteCmd;
	}

}
